<!DOCTYPE HTML>
<html>
  <head>
    <style>
      body {
        margin: 0px;
        padding: 0px;
      }
    </style>
  </head>
  <body>
    <div id="container"></div>
   
    <script src="http://www.html5canvastutorials.com/lib/KineticJS/kinetic-v5.0.1-beta.js"></script>
   <script src="js/main.js"></script>
   <script src="js/Tree.js"></script>
   <script src="js/View.js"></script>
   <script defer="defer">
      
	//Tree.js
	var treetry = new TreeNode(1,4,0,1,1);
	var View1 = new TreeView();
		
	//View1.layer.clear();
	
	
	
	//var treeChild1a = new TreeNode(15,50,20,20,2);
	//var treeChild1b = new TreeNode(15,50,340,40,3);
	//var treeChild2 = new TreeNode(10,30,20,60,4);
	//treetry.addChild(treeChild1a);
	//treetry.addChild(treeChild1b);
	//treeChild1a.addChild(treeChild2);
	//treetry.printTree();
	//View.js
	
	
	//View1.growView(treetry, 40,0);
	this.testV = function(steps, start){
   	
   	if (steps>=start){
   		start++;
   		
   		View1.layer.destroy();
   		
   		View1.view(treetry,200,400,0);
   		
   		treetry.grow();
   		
   		setTimeout(function(){
   			testV(steps,start);
   			
   		},300);
   		
   		
   		  	
   }
   };
   testV(40,0);
	//View1.animView(treetry, 40,0);
	//View1.view(treetry, 200, 400,0);

    </script>
  </body>
</html>